Skip to content

v0.10.1: command-line gaps before the next brick (describe, check, declare-masks, convert) - #620

Open
guijacquemet wants to merge 3 commits into
mainfrom
claude/cool-dijkstra-lngj7d
Open

guijacquemet wants to merge 3 commits into
mainfrom
claude/cool-dijkstra-lngj7d

Conversation

@guijacquemet

@guijacquemet guijacquemet commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Command-line gaps a new user hit before reaching fiberfeatures (the clean-environment test of the v0.10.0 wave, 3 December 2026). Unreleased v0.10.1; no format change.

  • cli_describe.py: fast describe no longer crashes (IndexError in _unit_of) when images are fewer than three folder levels deep (exp/condition_x/img.tif, or one OME-Zarr in the experiment folder). The tagged unit now comes from the discovered leaf folder's labels (_image_units), so missing levels are single, as in the draft.
  • cli_describe.py, fast_answers.py: new --rgb-header-override [FOLDER] (fast mode, needs --image-type rgb).
    • Without a folder it covers every unit. With a folder (an acquisition folder relative to the experiment, repeatable) it covers only that one.
    • It records rgb_header_override = true on the unit, exactly as the notebook's Image type card does.
    • It is refused for a channel list, an unknown folder, a published description and --strict.
  • physical_unit.py, description_run_text.py: the refusal of minisblack RGB TIFFs (R_IMAGE_TYPE_CONTRADICTS_HEADER, and the R_FAST_LAYOUT_CONTRADICTION detail and action) now names the CLI option beside the notebook card.
  • cli.py, physical_check.py: check reports an undeclared mask type as run refuses it. Both go through the shared undeclared_mask_types (R_MASK_TYPE_NOT_DECLARED, same text), OME-Zarr label images included, and check exits 1.
    • The message no longer says "the masks folder" for label images.
    • The fix names the type found (--type cells=REPRESENTATION) and never suggests a representation.
  • cli_declare_masks.py: without --masks, the next commands no longer print --masks MASKS; a line says when to add a masks folder. EXPERIMENT is printed only when no run of the output folder records the experiment.
  • cli_describe.py: fast mode lists open questions only while the options leave some. Otherwise it says the options answered them, instead of "answered by you, in the notebook".
  • image_type.py, run/description_run.py, cli_run.py, cli.py: check and run suggest rgb when the published description declares every acquisition rgb and RGB is possible (declared_image_type, review_image_type(..., declared=)).
  • cli_convert.py: new convert --store ome-tiff|ome-zarr (default ome-tiff). The texts name the format written.
  • Docs: user guide §5 (describe: shallow layouts, open questions, --rgb-header-override; convert: OME-Zarr copies and the H&E route; declare-masks), the §8 rows, contract §13, AGENTS.md, and the CHANGELOG under "Unreleased (v0.10.1)".

Decisions

  • Item 5, the image type of RGB OME-Zarr copies. The suggestion cannot follow the converter's output:
    • OME-NGFF 0.4 has no colour field. The omero colours are display only (written white).
    • The conversion record does not record RGB.
    • So the suggestion follows the user's published description instead, which every run already requires.
    • Before this change, run on such copies recorded image_type: fluorescence in the manifest even though the description said rgb.
  • Only a description declaring every unit rgb changes the suggestion, and only when the images can be RGB. A recorded image type from an earlier run still takes precedence, as before.

Notes for review

  • I did not edit entry_identity.py or the H&E tissue-mask rule.
  • The notebook pins are unchanged (they move only in the release PR).
  • The --store ome-zarr route was checked end to end in tests: convert RGB TIFFs, then describe as rgb, check, run, and the manifest records image_type: rgb. Not tried on the Zenodo 4550300 data itself.
  • Review fixes (commit 2da8c17): the texts run and check share no longer name a describe option (describe prints its own command line, and the override hint appears only for images the override can lift: three interleaved samples under a header not saying colour, PhysicalIssue.override_fits); check's discovery_report.json records R_MASK_TYPE_NOT_DECLARED; the mask fix is shell-quoted; --rgb-header-override without --channels says what is missing, and the bare form mixed with folders is refused; --accept-ids leaves ID questions with no proposal open; counts use plural().
  • A run before this fix that recorded fluorescence for RGB OME-Zarr keeps it on reruns unless --image-type rgb is given (existing precedence: given, then recorded, then suggested).

Tests

  • New: tests/test_cli_usability.py, 20 tests covering all six items and the review fixes.
  • ruff check ., ruff format --check . and python tools/check.py --rules pass.
  • Full suite locally (pytest -n 4, Python 3.13, zarr 3.4.2): 9193 passed, 32 skipped (the skips include the skimage-dependent tissue-mask tests). GitHub Actions is blocked, so CI did not run.

Generated by Claude Code

- describe: fast mode no longer crashes on images fewer than three folder
  levels deep (condition/img.tif, an image in the experiment folder); the
  tagged unit comes from the discovered leaf folder.
- describe --rgb-header-override [FOLDER]: records rgb_header_override = true
  as the notebook does; the refusal of minisblack RGB TIFFs names it.
- check reports an undeclared mask type (OME-Zarr labels included) as run
  refuses it; declare-masks prints next commands without a placeholder
  masks folder when none was given.
- describe lists open questions only while the fast-mode options leave some.
- check and run suggest rgb when the published description declares every
  acquisition rgb (OME-Zarr states no colour interpretation).
- convert --store ome-zarr.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G3qp983bS22og2asjnEc8P
- The shared run/check texts no longer name a describe option; describe adds its own
  command-line line, and the override hint appears only for images it can lift
  (PhysicalIssue.override_fits).
- check's discovery_report.json records R_MASK_TYPE_NOT_DECLARED; the mask fix is
  shell-quoted.
- --rgb-header-override: without --channels says what is missing; the bare form mixed
  with folders is refused.
- --accept-ids leaves ID questions without a proposal open; counts use plural().

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G3qp983bS22og2asjnEc8P
@guijacquemet
guijacquemet marked this pull request as ready for review December 3, 2026 17:40

Copy link
Copy Markdown
Contributor Author

Combined check of integration/v0.10.1 (#621 + #620 + #622) with fiberfeatures integration/v0.9.1

Fresh Python 3.11 venv: preprocessing integration/v0.10.1 (9d052c2), fiberfeatures integration/v0.9.1, normalization v0.10.0, CellPatcher v0.10.0, MorphoFeature and MorphoObjects v0.8.0, torch 2.15 CPU. pip check is clean.

Suites

  • Preprocessing full suite: 9318 passed, 23 skipped, 0 failed (42 min).
  • fiberfeatures' full suite on top of it: 2518 passed, and only its known failures (details in CellMigrationLab/fiberfeatures#255).

The clean-install scenario of 3 December, again (synthetic data plus the repository's H&E core crop)

Check Result
#621: conda setuptools .egg-info (no RECORD) A real egg-info was installed in the venv. torch requires setuptools, so fiberfeatures' closure reaches it. brick_identity no longer lists or follows it: normalization's identity is certain, and the other bricks are uncertain only because of their editable installs.
#621: fast describe on exp/condition/img.tif Works for fluorescence (TIFF and OME-Zarr) and RGB.
#620: describe --rgb-header-override Colour TIFFs with a minisblack header and 3 samples: the description is published with rgb_header_override = true, and the run manifest records image_type_header_overridden.
#620: convert --store ome-zarr The OME-Zarr copies run through describe, run and fiberfeatures settings/check/run, including execution_route = "patch_window".
#620: declare-masks --type Cells=instances --type Tissue=binary, then run --masks and masks: the next commands it prints are right.
#622: tissue-mask (he_tissue_v2) On flips of tests/data/he_core_1B_D9_crop.npz saved as minisblack TIFFs, 35.0 % is kept on every image (not empty). fiberfeatures with region_mask = "HETissue" and stain_preset = "he_eosin" measures 35,876 px per image.

Findings, not fixed (owner's call)

  1. A condition folder named control is a dead end in fast mode. control is in description_rules.FORBIDDEN, so describe prints "control: no ID can be proposed (E_FORBIDDEN_FIELD): you name it", and --accept-ids --publish stops with "name it in the notebook". There is no command-line way to name it. Many first-time users will call a folder control. fiberfeatures' quick start now warns about it. Options: a describe --id control=ctrl style option, or proposing a non-forbidden ID.
  2. tissue-mask needs a run with a masks folder first. "the run has no masks folder; ... Run preprocessing with a masks folder first" is clear, but a user without masks has to make an empty folder and run again (run --masks EMPTY_FOLDER worked). Maybe worth one sentence in §5's H&E route.
  3. The channel-identity "Not checked (N): ... fewer than 3 other units ..." block prints on every run of a small experiment. It is correct, but long for a first run.

Generated by Claude Code

guijacquemet pushed a commit that referenced this pull request Dec 4, 2026
…wner's 4 December follow-ups

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G3qp9ASFzYU5CY2vs1ReWg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants